<?php

namespace App\Admin\Controllers\SysAccount;

use App\Admin\Controllers\BaseAdminController;
use App\Models\Open\SysAccountFollowReply;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Show;

class SysAccountFollowReplyController extends BaseAdminController
{
    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        return Grid::make(SysAccountFollowReply::with(['sysAccount']), function (Grid $grid) {
            $grid->column('content');
            $grid->column('updated_at')->sortable();

            $grid->filter(function (Grid\Filter $filter) {
            });
        });
    }

    /**
     * Make a show builder.
     *
     * @param mixed $id
     *
     * @return Show
     */
    protected function detail($id)
    {
        return Show::make($id, new SysAccountFollowReply(), function (Show $show) {
            $show->field('id');
            $show->field('sys_account_id');
            $show->field('content');
            $show->field('created_at');
            $show->field('updated_at');
        });
    }

    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        return Form::make(SysAccountFollowReply::with(['sysAccount']), function (Form $form) {
            $form->hidden('sys_account_id')->value(1);
            $form->textarea('content');
        });
    }
}
